package fr.teuteuf.runstickmanrun;

import tv.ouya.console.api.OuyaAuthenticationHelper;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;

public class MainActivity extends AndroidApplication {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
		cfg.useAccelerometer = false;
		cfg.useCompass = false;
		cfg.useGL20 = true;
		
		AccountManager am = AccountManager.get(this);
		Account[] accts = am.getAccountsByType(OuyaAuthenticationHelper.OUYA_ACCOUNT_TYPE);
		String username = accts[0].name+" (OUYA)";

		initialize(new RunStickmanRun(new OuyaKeyMap(), true, username), cfg);
	}
	
	@Override
	public void onBackPressed() {
	}
}